import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';

class DemoTestPage extends StatefulWidget {
  const DemoTestPage({Key? key}) : super(key: key);

  @override
  MapPageState createState() => MapPageState();
}

class MapPageState extends State<DemoTestPage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('demi'),
        ),
        body: Column(children: [
          Row(children: [
            MaterialButton(
              onPressed: () {
                showCupertinoDialog(
                    context: context,
                    builder: (buildContext) {
                      return Center(child: const Text('123'));
                    });
              },
              child: const Text('showCupertinoDialog'),
            ),
            MaterialButton(
              onPressed: () {
                showDatePicker(
                    context: context,
                    initialDate: DateTime.now(),
                    firstDate: DateTime.fromMillisecondsSinceEpoch(0),
                    lastDate:
                        DateTime.fromMillisecondsSinceEpoch(1840979000000));
              },
              child: const Text('showDatePicker'),
            ),
            MaterialButton(
              onPressed: () {
                showDateRangePicker(
                    context: context,
                    firstDate: DateTime.fromMillisecondsSinceEpoch(0),
                    lastDate:
                        DateTime.fromMillisecondsSinceEpoch(1840979000000));
              },
              child: const Text('showDateRangePicker'),
            ),
            MaterialButton(
              onPressed: () {
                final snackBar = SnackBar(
                  content: const Text('Yay! A SnackBar!'),
                  action: SnackBarAction(
                    label: 'Undo',
                    onPressed: () {
                      // Some code to undo the change.
                    },
                  ),
                );

                // Find the ScaffoldMessenger in the widget tree
                // and use it to show a SnackBar.
                ScaffoldMessenger.of(context).showSnackBar(snackBar);
              },
              child: const Text('showSnackBar'),
            ),
          ]),
          Row(
            children: [
              TextButton(
                  onPressed: () {
                    print(13123123123);
                    BoostNavigator.instance.push('activity2').then((value) {
                      print(value);
                    });
                    // Navigator.of(context).pushNamed('activity2');
                  },
                  child: Text('to_android_activity2'))
            ],
          )
        ]));
  }
}
